<?phpclass JF_ImageFile  { //extends JFObject {	protected $imageRes = NULL;	function __construct(JF_ImageData $imgdata) {		$this->imageRes = $imgdata->get();	}		function instance(JF_ImageData $imgdata) {		return new self( $imgdata );	}			function saveAsJPG($path, $quality = 75) {		$success = imagejpeg($this->imageRes, $path, $quality );		if( !$success ) throw new Exception('Could not save as JPG');	}	function saveAsPNG($path) {		$success = imagepng($this->imageRes, $paths);		if( !$success ) throw new Exception('Could not save as PNG');	}	function saveAsGIF($path) {		$success = imagegif($this->imageRes, $path);		if( !$success ) throw new Exception('Could not save as GIF');	}	}